package pluginMain;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class HorseSpawner extends JavaPlugin {
	public enum CONFIG {
		SPAWN_PERM, SPAWN_LIMIT, SPAWN_MAX, SPAWN_COLDDOWN, SPAWN_SECOND
	}

	public final String PLUGIN_NAME = "HorseSpawner";
	public final Logger CONSOLE_LOGGER = this.getLogger();
	public List<String> lConfig;

	public void LOGCONSOLE(String msg) {
		CONSOLE_LOGGER.info(msg);
	}

	public boolean PERMCHECK(CommandSender sender, String perm) {
		if (sender instanceof Player) {
			if (sender.hasPermission(perm))
				return true;
		}
		return false;
	}

	public void loadConfig() {
		lConfig = new ArrayList<String>();
		if (!this.getDataFolder().exists()) {
			try {
				this.getDataFolder().createNewFile();

			} catch (IOException e) {
				e.printStackTrace();
			}
		}

	}
	@Override
	public boolean onCommand(CommandSender sender, Command cmd, String label,
			String[] args) {
		if(sender instanceof Player){
			if(cmd.getName().equalsIgnoreCase("hss")){
				if(PERMCHECK(sender,label)){
					
				}
			}
		}else{
			return false;
		}
		return false;

	}

	@Override
	public void onEnable() {
		LOGCONSOLE(PLUGIN_NAME + " has been started.");
	}

	@Override
	public void onDisable() {
		LOGCONSOLE(PLUGIN_NAME + " has been disabled.");
	}
	
	public void spawnHorse(){
		
	}
	
	public void checkPlayerColddownTime(){
		
	} 

}
